package com.tiancheng.trade.settlement.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 收入记录状态
 *
 * @author likailun
 * @date 2021/04/25
 */
@Getter

@AllArgsConstructor
public enum RevenueStatusEnum{
    NORMAL(0, "正常"),
    NO_MERCHANT(1, "缺少商户信息"),
    NO_REVENUE_TYPE(2, "缺少收入确认类型"),
    NOT_SUPPORT_REVENUE_TYPE(3, "不支持的收入确认类型"),
    INVALID(9, "无效数据"),
    ;

    private final Integer code;
    private final String desc;

    public static String getRevenueStatusName(Integer code) {
        RevenueStatusEnum[] revenueStatusEnums = values();
        for (RevenueStatusEnum statusEnum : revenueStatusEnums) {
            if (statusEnum.getCode().equals(code)) {
                return statusEnum.getDesc();
            }
        }
        return null;
    }
}
